package com.aaa.behind.dao;

import com.aaa.entity.Bid;
import com.aaa.entity.OOrder;
import com.aaa.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 订单信息 Mapper 接口
 * </p>
 *
 * @author whj
 * @since 2023-01-05
 */
public interface OOrderMapper extends BaseMapper<OOrder> {
    List<Order> findSname();

    @Select("SELECT gname FROM o_order o ,g_goods g WHERE o.goodsid = g.id AND o.code = #{code} and g.isdeleted = 0")
    String findGname(String code);


    @Update("update o_order set state = #{state} where code = #{code}")
    boolean updState(@Param("code") String code,@Param("state") Integer state);


    IPage rotationSearch(IPage page);

    IPage selectGname(IPage page,@Param("bid") Bid bid);
}
